/**
 * 
 */
package net.cloudcodex.client.home.view.panel;

import java.util.List;

import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;

/**
 * @author Daniel
 * 
 */
public abstract class AbstractInfoPanel extends FlowPanel {

	
	
	protected abstract void initPanel();

	protected HorizontalPanel getPanel(String title, String value) {
		HorizontalPanel hPanel = new HorizontalPanel();
		hPanel.setStyleName("infoLinePanel");
		Label titleInfoLabel = new Label(title + " : ");
		titleInfoLabel.setStyleName("infolineTitleLabel");
		hPanel.add(titleInfoLabel);
		Label valueInfoLabel = new Label(value);
		valueInfoLabel.setStyleName("infolineValueLabel");
		hPanel.add(valueInfoLabel);
		this.setStyleName("infoPanel");
		return hPanel;
	}

	protected String getListAsString(List<String> list) {
		// String result = StringUtils.join(campaignPlayers, ",");
		StringBuffer listAsText = new StringBuffer();
		if (list != null) {
			for (String player : list) {
				listAsText.append(player + ",");
			}
		}
		return listAsText.toString();
	}


}
